<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path=request.getContextPath()+"/"; %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html class="x-admin-sm">
    
    <head>
        <base href="<%=path%>" >
        <meta charset="UTF-8">
        <title>企业信息上传列表</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="layui/css/font.css">
        <link rel="stylesheet" href="layui/css/xadmin.css">
        <script src="layui/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="layui/js/xadmin.js"></script>
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    
    <body>

     <form id="form">

         <input type="hidden" name="pageNumber" value="${page.pageNum}" id="pageNumber" />
         <input type="hidden" name="pageSize" value="${page.pageSize}" />
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <form class="layui-form layui-col-space5">
                            </form>
                        </div>
                        <div class="layui-card-body ">
                            <table class="layui-table" lay-filter="test">
                                <thead>
                                    <tr align="center">
                                        <td>序号</td>
                                        <td>时间</td>
                                        <td>基本信息名称</td>
                                        <td>更新时间</td>
                                        <td>详情</td>
                                      </tr>
                                </thead>
                                <tbody>
                                    <c:forEach items="${data}" var="companyList" varStatus="vs">
                                    <tr align="center">
                                        <td>${vs.index+1}</td>
                                        <td>${companyList.operateTime}</td>
                                        <td>
                                            <a href="">
                                                ${companyList.companyName}基本信息表
                                            </a>
                                        </td>
                                        <td>${companyList.lastSavetime}</td>
                                        <td>
                                            <a class="layui-btn" title="详情"  onclick="xadmin.open('详情','skip/view?companyId='+${companyList.companyId},'','',true)" href="javascript:;">
                                                详情
                                            </a>
                                        </td>
                                    </tr>
                                    </c:forEach>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-card-body ">
                            <div class="page" id="page"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
     </form>
    </body>
    <script type="text/html" id="switchTpl">
        <!-- 这里的checked的状态只是演示 -->
        <!--<input type = "checkbox" name = "sex" value = "{{d.id}}" lay-skin = "switch"lay-text = "女|男" lay-filter = "sexDemo" {{ d.id == 10003 ? 'checked': ''}} >-->
    </script>
    <script>
        layui.use(['laydate','form','layer','jquery','laypage','upload'],
        function() {
            var laydate = layui.laydate;
            var form = layui.form;
            layer = layui.layer;
            $=layui.jquery;
            laypage = layui.laypage;
            var upload = layui.upload;

            //渲染分页
            laypage.render({
                elem:'page',
                count:parseInt('${page.total}'),
                limit:parseInt('${page.pageSize}'),
                curr:${page.pageNum},
                layout:['prev', 'page', 'next'],
                jump:function(obj,first){
                    if(!first){
                        // 手动在切换页码
                        $("#pageNumber").val(obj.curr);
                        $("#form").submit();
                    }
                }

            });


            //执行一个laydate实例
            laydate.render({
                elem: '#start' //指定元素
            });
//指定允许上传的文件类型
            upload.render({
                elem: '#test6'
                ,url: 'https://httpbin.org/post' //改成您自己的上传接口
                ,accept: 'file' //普通文件
                ,done: function(res){
                    layer.msg('上传成功');
                    console.log(res);
                }
            });
            //年月选择器
            laydate.render({
                elem: '#test3'
                ,type: 'month'
            });

            //执行一个laydate实例
            laydate.render({
                elem: '#end' //指定元素
            });

        });</script>
    <script>layui.use('table',
        function() {
            var table = layui.table;

            //监听单元格编辑
            table.on('edit(test)',
            function(obj) {
                var value = obj.value //得到修改后的值
                ,
                data = obj.data //得到所在行所有键值
                ,
                field = obj.field; //得到字段
                layer.msg('[ID: ' + data.id + '] ' + field + ' 字段更改为：' + value);
            });

            //头工具栏事件
            table.on('toolbar(test)',
            function(obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                case 'getCheckData':
                    var data = checkStatus.data;
                    layer.alert(JSON.stringify(data));
                    break;
                case 'getCheckLength':
                    var data = checkStatus.data;
                    layer.msg('选中了：' + data.length + ' 个');
                    break;
                case 'isAll':
                    layer.msg(checkStatus.isAll ? '全选': '未全选');
                    break;
                };
            });
        });</script>
    <script>var _hmt = _hmt || []; (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();</script>

</html>